package bean;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

@Component("ob")
@Lazy
public class OtherBean {

//    @Value("abc")
    @Value("${str}")
    private String str;


//    @Value("123")
    @Value("${var}")
    private int var;


    public OtherBean() {
        System.out.println("OtherBean.OtherBean()");
    }

    @PostConstruct
    public void a(){
        System.out.println("OtherBean.a()");
    }

    @PreDestroy
    public void b(){
        System.out.println("OtherBean.b()");
    }

    public String getStr() {
        return str;
    }

    public void setStr(String str) {
        this.str = str;
    }

    public int getVar() {
        return var;
    }

    public void setVar(int var) {
        this.var = var;
    }
}
